// pages/collectInfo/collectInfo.js
import request from '../../utils/request'
Page({

    /**
     * 页面的初始数据
     */
    data: {
        collectionList: [],
        collectionListT: [],
        id: Number,
        image2: String,
        collectionNumber:1234,
        messageNumber:2342,
        relateNumber:32423,
        first: Number,
        second:Number,
        third:Number,
        songs:String,

    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
        let id = options.id;
       this.setData({id});
       this.getCollectionList(id);
    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {

    },

    async getCollectionList(id) {
        let collectionList = await request('/album',{id: id});
        let collectionListT = await request('/album/detail/dynamic',{id: id})
        let  songs = id
   
        
        this.setData({
            collectionList,
            collectionListT,
            songs,
            image2 : collectionList.album.blurPicUrl,
            first:collectionListT.subCount,
            second :collectionList.album.info.commentCount,
            third: collectionList.album.info.shareCount

        })
        
        console.log(this.data.image2)
        console.log(this.data.collectionList)
        console.log(this.data.collectionListT)
      },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {

    },

    

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {

    }
})